#include<bits/stdc++.h>
#define ll long long
using namespace std;

int n,f[305],g[305],ans;
bitset<105> h;
char s[305];

inline bool check()
{
    for(int i=1;i<=n;i++)
    {
        f[i]=f[i-1];
        if(f[i]==-1)
            continue;
        if(s[i]=='(')
            f[i]++;
        else
            f[i]--;
    }

    for(int i=n;i;i--)
    {
        g[i]=g[i+1];
        if(g[i]==-1)
            continue;
        if(s[i]==')')
            g[i]++;
        else
            g[i]--;
    }

    for(int i=1;i<=n;i++)
        h[i]=0;
    h[0]=1;

    for(int i=1;i<=n;i++)
    {
        if(s[i]==')')
            h<<=1;
        else
            h>>=1;
        if(f[i]!=-1)
            h[f[i]]=1;
        if(g[i+1]!=-1&&h[g[i+1]])
            return 1;
    }

    return 0;
}

inline void dfs(int u)
{
    if(u==n+1)
    {
        ans+=check();
        return;
    }

    if(s[u]=='x')
    {
        s[u]='(';
        dfs(u+1);
        s[u]=')';
        dfs(u+1);
        s[u]='x';
        return;
    }

    dfs(u+1);
}

int main()
{
    freopen("bracket.in","r",stdin);
    freopen("bracket.out","w",stdout);
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    
    cin>>n>>(s+1);
    dfs(1);
    cout<<ans<<'\n';

    return 0;
}